package com.lagou.app;

import com.lagou.utils.DruidUtils;

import java.sql.*;

public class TestDruid {
    public static void main(String[] args) throws SQLException {
        Connection con = DruidUtils.getConnection();
       //创建sql语句执行对象
        Statement statement = con.createStatement();
        ResultSet resultSet = statement.executeQuery("select * from jdbc_user");
        while (resultSet.next()){
            int id = resultSet.getInt("id");
            String username = resultSet.getString("username");
            String password = resultSet.getString("password");
            Date birthday = resultSet.getDate("birthday");
            System.out.println(id+":"+username+":"+password+":"+birthday);
        }
        DruidUtils.close(con,statement,resultSet);
    }
}
